package me.zhengjie.minbearwcs.entity.DTO.response;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class RespWithObject<T> {
    private String returnCode = RespPool.RETURN_WEB_CODE_SUCCESS;
    private String returnReason = "";
    private T returnData;



    public RespWithObject<T> code(boolean code){
        returnCode = code? RespPool.RETURN_WEB_CODE_SUCCESS: RespPool.RETURN_WEB_CODE_FAIL;
        return this;
    }

    public RespWithObject<T> reason(String res){
        returnReason = res;
        return this;
    }

    public RespWithObject<T> data(T res){
        returnData = res;
        return this;
    }
}
